// 外部状态
export const initialState = {
  a: '11',
  b: '22',
}

// 外部状态逻辑
export const reducer = (preState, { type, payload }) => {
  console.log('reducer', preState, type, payload)
  let state = { ...preState }
  switch (type) {
    case 'child2':
      state.a = payload
      return state
    case 'child3':
      state.b = payload
      return state
    default:
      return preState
  }
}
